package org.winFame;

import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.control.ScrollPane;
import org.App;

public class WinShow {
    public static ScrollPane scrollPane = new ScrollPane ();
    static {
        init();
    }
    public static void init() {
        scrollPane.setContent(FlowPaneFrameWork.flowPane);
        scrollPane.setFitToWidth(true);
        scrollPane.setLayoutY(60);
        scrollPane.setStyle("-fx-background-color: #eeeeee;");
        PaneFrame.pane.widthProperty().addListener(new ChangeListener<Number>() {
            @Override
            public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                scrollPane.setPrefWidth((Double) newValue);
            }
        });

        PaneFrame.pane.heightProperty().addListener(new ChangeListener<Number>() {
            @Override
            public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                scrollPane.setPrefHeight((Double) newValue-70);
            }
        });
    }
}
